Call generic_phy_init() only when a PHY was found.
This will avoid a crash if no "phys" property is found in DT.
Signed-off-by: Patrice Chotard <[email protected]>
Reported-by: Patrick Delaunay <[email protected]>
error("failed to get usb phy\n");
goto reset_err;
}
- }
+ } else {
- err = generic_phy_init(&priv->phy);
- if (err) {
- error("failed to init usb phy\n");
- goto reset_err;
+ err = generic_phy_init(&priv->phy);
+ if (err) {
+ error("failed to init usb phy\n");
+ goto reset_err;
+ }
}
hccr = map_physmem(devfdt_get_addr(dev), 0x100, MAP_NOCACHE);